home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
COMAL
/
A-COMAL Series
/
(k)aai.d64
/
read'block.lst
< prev
next >
Wrap
File List
|
2007-02-28
|
1KB
|
40 lines
9000 //
9010 FUNC READ'BLOCK(TRACK,SECTOR,REF BLOCK$)
9020 DIM T$ OF 2, S$ OF 2, DS$ OF 2
9030 MEM:=1000
9040 STR(TRACK,T$); STR(SECTOR,S$)
9050 IF PEEK(MEM)<>162 THEN DISK'GET'INIT(MEM)
9060 OPEN FILE 2,"#2",UNIT 8,2,READ
9070 DS$:=STATUS$
9080 IF DS$="00" THEN
9090 PASS "U1: 2 0 "+T$+" "+S$
9100 BLOCK$(1:256):=""
9110 IF BLOCK$="" THEN NULL
9120 START:=PEEK(51)+PEEK(52)*256+4
9130 POKE 51,START MOD 256
9140 POKE 52,START DIV 256
9150 SYS 1000
9160 ENDIF
9170 CLOSE FILE 2
9180 RETURN DS$<>"00"
9190 ENDFUNC READ'BLOCK
9200 //
9210 PROC DISK'GET'INIT(START) CLOSED
9220 A:=START
9230 WHILE NOT EOD DO
9240 READ BYTE
9250 POKE A,BYTE
9260 A:+1
9270 ENDWHILE
9280 DATA 162,2,32,198,255,160,0
9290 DATA 32,207,255,145,51,200,208
9300 DATA 248,32,204,255,96
9310 ENDPROC DISK'GET'INIT
9320 //
9330 PROC STR(NUM,REF STRING$)
9340 STRING$:=CHR$((NUM MOD 10)+48)
9350 IF NUM DIV 10 THEN
9360 STRING$:=CHR$((NUM DIV 10)+48)+STRING$
9370 ENDIF
9380 ENDPROC STR